﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FCS.Test
{
    /// <summary>
    /// Summary description for EqualsTest
    /// </summary>
    [TestClass]
    public class EqualsTests : Functional
    {
        public EqualsTests()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod]
        public void AreEqualTest()
        {
            var l1 = IntList(1, 10);
            var l2 = IntList(1, 10);

            Assert.IsTrue(Equals(l1, l2));

            l1 = IntList(2, 2);
            l2 = IntList(2, 2);

            Assert.IsTrue(Equals(l1, l2));

            l1 = IntList(2, -2);
            l2 = IntList(2, -2);

            Assert.IsTrue(Equals(l1, l2));
        }

        [TestMethod]
        public void AreNotEqualTest()
        {
            var l1 = IntList(1, 9);
            var l2 = IntList(1, 10);

            Assert.IsFalse(Equals(l1, l2));

            l1 = IntList(1, 10);
            l2 = IntList(1, 9);

            Assert.IsFalse(Equals(l1, l2));

            l1 = IntList(2, 11);
            l2 = IntList(1, 10);

            Assert.IsFalse(Equals(l1, l2));
        }
    }
}
